﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FluentNHibernate.Mapping;

namespace Managistics.Model.Mappings
{
    public class SupplierMap : ClassMap<Supplier>
    {

        public SupplierMap()
        {
            Schema(Constants._tblSchema);
            Table(Constants._tblSupplier);
            LazyLoad();

            Id(x => x.Id).GeneratedBy.Assigned().Column("SUPPLIERID");
            Map(x => x.Name).Column("SUPPLIERNAME").Not.Nullable().Length(500);
            Map(x => x.TelSupplier).Column("TEL_SUPPLIER").Not.Nullable().Length(20);
            Map(x => x.FaxSupplier).Column("FAX_SUPPLIER").Length(20);
            Map(x => x.AddressSupplier).Column("ADDRESS_SUPPLIER").Not.Nullable().Length(150);
            Map(x => x.WebsiteSupplier).Column("WEBSITE_SUPPLIER").Length(50);
            Map(x => x.ContactNameSupplier).Column("CONTACT_NAME_SUPPLIER").Length(50);
            Map(x => x.TypeSuppliers).Column("TYPE_SUPPLIERS").Not.Nullable().Length(1);
            Map(x => x.OrtherInformation).Column("ORTHER_INFORMATION").Length(150);
            Map(x => x.TaxCodeS).Column("TAX_CODE_S").Length(20);
            Map(x => x.DeadlineS).Column("DEADLINE_S").Length(20);
            Map(x => x.DeliveryS).Column("DELIVERY_S").Length(20);
            Map(x => x.DiscountS).Column("DISCOUNT_S").Precision(53);
            Map(x => x.BankAccountS1).Column("BANK_ACCOUNT_S1").Length(20);
            Map(x => x.BankAccountS2).Column("BANK_ACCOUNT_S2").Length(20);
            Map(x => x.MobileSupplier).Column("MOBILE_SUPPLIER").Length(20);
        }
    }
}
